% se2-design.tex


% declare this document to be of class uw-wkrpt (variant se)
%\documentclass[se,legalpaper]{uw-wkrpt}
\documentclass[final]{se2-design}
\usepackage{times}
\usepackage{ifthen}
% we need a glossary
%\usepackage{glosstex}

% we want to be able to use graphics, so import them
\usepackage{graphicx}
\usepackage{wrapfig}

\urlstyle{rm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set up some variables to make life easier
\newcommand{\tm}{\texttrademark}

\newcommand{\todo}[1]{\textbf{#1}}

% subsubsubsection stuff
\usepackage{subsections}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\usepackage{multirow}

\usepackage{chngcntr}
\usepackage{setspace}
\counterwithin{figure}{section}


\newcommand{\definitionentry}[2] {\hangindent=3em \hangafter=1 \noindent \textbf{#1:} \textrm{#2} \vspace{1em}}


% and begin
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% setup the document
\title{Assignment 3: Distributed File System \\User Manual}
\group{11}
%\member{Full name}    {Student#}{email user}{email domain}
\member{Yanna Kang}    {20146835}{yanna.kang}{gmail.com}
\member{Colin Rhodes}  {20130560}   {cprhodes}{uwaterloo.ca}
\member{Charles Dang}  {20128568} {c3dang}{uwaterloo.ca}
\member{Eric Allen}    {20125887}   {eaallen}{uwaterloo.ca}
\school{University of Waterloo}
\faculty{Faculty of Engineering}
\program{ECE454}
\term{S07}
%\date{May 8, 2007}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{roman}
\tableofcontents
%TODO: Add list of figures/tables back if we need it
%\listoffigures
%\listoftables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% body
\mainmatter{}

\section{System Overview}
CYCE Distributed File System is a tool that allows peers to share files over a network.  The system consists of two central servers to coordinate transactions and a set of peers.  Peers can upload, download, and delete files in the system.  When a peer uploads a file, it notifies a server that it is making the file available.  The server then notifies all of the peers that the new file is available.  When a peer requests to download the file, the server tells this peer how to contact the peer offering the file.  The downloading peer will then request that the hosting peer send the shared file over the network.

\section{Configuration}
Both the servers and the peers have XML configuration files as described below.

\subsection{Server Configuration}
The server configuration file, \verb|serverConfig.xml|, contains the following data. \\

\noindent\verb|<?xml version="1.0" encoding="UTF-8"?>| \\
\verb|<config>| \\
\verb|  <setting name="fileXMLPath">fileXMLPath</setting>| \\
\verb|  <setting name="primaryServerName">primaryServerName</setting>| \\
\verb|  <setting name="primaryServerPort">primaryServerPort</setting>| \\
\verb|  <setting name="secondaryServerName">secondaryServerName</setting>| \\
\verb|  <setting name="secondaryServerPort">secondaryServerPort</setting>| \\
\verb|</config>| \newline

\definitionentry{fileXMLPath}{The path on the server to the XML file containing the list of files.  The server must have read-write permissions on this file.}

\definitionentry{primaryServerName}{The hostname of the primary server.}

\definitionentry{primaryServerPort}{The port on which the primary server accepts incoming connections.}

\definitionentry{secondaryServerName}{The hostname of the secondary server.}

\definitionentry{secondaryServerPort}{The port on which the secondary server accepts incoming connections.}


\subsection{Peer Configuration}
The peer configuration file, \verb|peerConfig.xml|, contains the following data. \\

\noindent\verb|<?xml version="1.0" encoding="UTF-8"?>| \\
\verb|<config>| \\
\verb|  <setting name="primaryServerName">primaryServerName</setting>| \\
\verb|  <setting name="primaryServerPort">primaryServerPort</setting>| \\
\verb|  <setting name="secondaryServerName">secondaryServerName</setting>| \\
\verb|  <setting name="secondaryServerPort">secondaryServerPort</setting>| \\
\verb|  <setting name="fileXML">fileXML</setting>| \\
\verb|  <setting name="localFileStore">localFileStore</setting>| \\
\verb|</config>| \\

\definitionentry{primaryServerName}{The hostname of the primary server.}

\definitionentry{primaryServerPort}{The port on which the primary server accepts incoming connections.}

\definitionentry{secondaryServerName}{The hostname of the secondary server.}

\definitionentry{secondaryServerPort}{The port on which the secondary server accepts incoming connections.}

\definitionentry{fileXML}{The path on the peer to the XML file containing the list of files.  The peer must have read-write permissions on this file.}

\definitionentry{localFileStore}{The path of the directory where the application will store uploaded (shared) files.}


\section{Starting the System}

After configuring the servers and peers, the system can be started using the following steps:

\begin{itemize}
\item Start the primary server by running `java cyce.server.Server primary' on the host specified in the config files
\item Start the secondary server by running `java cyce.server.Server secondary' on the host specified in the config files
\item Start each peer by running `java cyce.peer.PeerUI' on the client machine
\end{itemize}

\section{User Interface}

The peer user interface is shown in Figure \ref{fig:screenshot}.  Each of its components is described below.  \newline

\definitionentry{1}{List of all files and directories currently in the distributed file system.}

\definitionentry{2}{Download a selected file.  This button launches a save dialog for the user to indicate the location for the file to be saved.  This button is only active when a file is selected.}

\definitionentry{3}{Delete a selected file from the distributed file system.  This button is only active when a file is selected.}

\definitionentry{4}{Delete a directory and all items contained within the directory from the distributed file system.  This button is only active when a non-root directory is selected.}

\definitionentry{5}{Adds a directory to the distributed file system.  This button launches an input dialog for the user to indicate the name of the new directory.  This button is only active when a directory is selected.}

\definitionentry{6}{Adds a file to the distributed file system.  This button launches an open dialog for the user to indicate the file to upload.  It then launches an input dialog for the user to indicate the filename to use in the distributed file system.  This button is only active when a directory is selected.}

\begin{figure}
  \begin{centering}
  \includegraphics[width=2.5in]{screenshot.png}
  \caption{CYCE Distributed File System Client}
  \label{fig:screenshot}
  \end{centering}
\end{figure}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% back matter (more Ewww :) )
\backmatter{}

%\bibliography{se2-design-bib}

\section{Acknowledgements}\label{sec:acknowledgements}
We would like to thank Mr. Simon Law for his uw-wkrpt \LaTeX{} classes
from which this document's formatting is derived.

% if you want to use glosstex, you'll have to fudge with page numbers
% fudge with page numbers:
%\addtocontents{toc}{\protect\contentsline{section}{Glossary}{19}}
% proper way:
% \addcontentsline{toc}{section}{Glossary}
% do the glossary
%\printglosstex(glo)

%\section{Glossary}\label{sec:glossary}
%Some glossary here

% cue the fat lady
\end{document}

